class AVRiLIIProjB extends AVRiLProj;

simulated function Explode(vector HitLocation, vector HitNormal)
{
    local Controller C;
    local PlayerController  LocalPlayer;

    bHasExploded = True;

    // Don't explode if this is a dud
    if( bDud )
    {
        Velocity = vect(0,0,0);
        LifeSpan=1.0;
        SetPhysics(PHYS_Falling);
    }


    PlaySound(ExplosionSound,,2.0);
    if ( EffectIsRelevant(Location,false) )
    {
        Spawn(class'AVRiLIIProjBEmitter',,,HitLocation + HitNormal*20,rotator(HitNormal));
        Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
    }

    BlowUp(HitLocation);
    Destroy();

    // Shake nearby players screens
    LocalPlayer = Level.GetLocalPlayerController();
    if ( (LocalPlayer != None) && (VSize(Location - LocalPlayer.ViewTarget.Location) < DamageRadius) )
        LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);

    for ( C=Level.ControllerList; C!=None; C=C.NextController )
        if ( (PlayerController(C) != None) && (C != LocalPlayer)
            && (VSize(Location - PlayerController(C).ViewTarget.Location) < DamageRadius) )
            C.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
}

function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
{
    if( damageType == class'SirenScreamDamage')
    {
        Explode(HitLocation, vect(0,0,1));
    }    
}

defaultproperties
{
     ExplosionSound=SoundGroup'Amb_Destruction.explosions.Expl_Brick_House01'
     ArmDistSquared=50000.000000
     ImpactDamage=2000
     Speed=900.000000
     MaxSpeed=900.000000
     Damage=2000.000000
     DamageRadius=700.000000
     MomentumTransfer=250000.000000
     DrawScale3D=(X=2.400000,Y=2.700000,Z=2.700000)
     Skins(0)=Combiner'KF_Specimens_Trip_T.patriarch_env_cmb'
     TransientSoundRadius=3000.000000
}
